package KK.Animation
{
	import KK.Time.FrameWheel;
	import KK.Time.IWheel;
	import KK.Time.Time;
	
	import flash.geom.Rectangle;
	import flash.utils.getTimer;

	public class SheetBase implements IWheel
	{
		
		
		protected var _frameRate:uint; 
		protected var loop:Boolean;
		private var _frameState:uint;
		
		private var _wheelRect:Vector.<int>;
		
		
		
		
		public function SheetBase( frameRate:uint=24,loop:Boolean=true)
		{
			
			this._frameRate=frameRate;
			this.loop=loop;
			
			
			init();
		}
		
		private function init ():void{
			
		}
		
		/**
		 * 获取帧频 
		 * @return 
		 * 
		 */
		public function get frameRate():uint{
			return _frameRate;
		}
		
		/**
		 * 获取定时区域 
		 * @return 
		 * 
		 */
		public function getWheelArea():Vector.<int>{
			return _wheelRect;
		}
		/**
		 * 设置 
		 * @param rect
		 * 
		 */
		public function setWheelArea(rect:Vector.<int>):void{
			_wheelRect=rect;
		}
		
		/**
		 * 获取状态  
		 * @return 
		 * 
		 */
		public function get frameState():Boolean{
			return _frameState==FrameWheel.START;
		}
		
		
		/**
		 * 消息循环  
		 * 
		 */
		protected function GameLoop():void{
			
		}

		/**
		 * 定时器回调  
		 * 
		 */
		public function UpdateFrame():void{
			GameLoop();
		}
		
		/**
		 * 停止 
		 * 
		 */
		public function frameStop():void{ 
			_frameState=FrameWheel.STOP;
		}
		
		/**
		 * 定时器开始  
		 * 
		 */
		public function frameStart():void{
			_frameState=FrameWheel.START;
		}
		
	}
}